#include <stdio.h>

#define N 10

// 输入m行n列矩阵
void ReadArray(int (*array)[N], int m, int n);
/*检查m行n列矩阵没列是否有空位，空位的个数记录在result中*/
void judge(int (*array)[N], int m, int n, int *result);
// 输出检查结果
void PrintResult(int *result, int m);
int main()
{
    int n, m, array[N][N];
    int result[N] = {0};
    printf("Please enter rows and columns:\n");
    scanf("%d %d", &m, &n);
    printf("Please enter array elements(0/1):\n");
    ReadArray(array, m, n);
    judge(array, m, n, result);
    printf("Result:\n");
    PrintResult(result, n);
    return 0;
}

void ReadArray(int (*array)[N], int m, int n)
{
    int i,j;//输入数值，读取输入的数值与位置
    for(i=0;i<m;i++)
    {
        for(j=0;j<n;j++)
        {
            scanf("%d",&array[i][j]);
        }
    }
    return;
}

void judge(int (*array)[N], int m, int n, int *result)
{
    int i,j;//判断当前位置是1还是0，要根据列来判断
    for(j=0;j<n;j++)
    {
        int count=0;
        for(i=0;i<m;i++)
        {
            if((array)[i][j]==0)
            {
                count++;
            }
        }
        result[j]=count;
    }
    return;
}

void PrintResult(int *result, int m)
{
    for (int i = 0; i < m; i++)//调整输出的格式，使其满足题目要求
    {
        if(result[i]==0)//根据result里面的结果决定输出的类型
        {
            printf("The %d column is full!",i);
        }
        else
        {
            printf("The %d column has %d empty spaces!",i,result[i]);
        }
        printf("\n");
    }
    return;
}